package com.aramco.fion.service
{
	import com.aramco.fion.model.FlexConstants;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.http.HTTPService;

	public class ManageTablesDelegate
	{
		
		var myService:HTTPService;
		
		var getAllParam:String = '<action type="GETALL"><table name="ZFI_FION_DB"></table></action>';
			
		public function getAll(tableName:Object):AsyncToken
		{
			var param:Object = new Object();
			param.XML = getAllParam;
			
			myService = new HTTPService();
		//	myService.url = FlexConstants.DB_TABLES_UPDATE_URL;
			myService.url = "http://khesab.aramco.com.sa:1080/sap/bc/bsp/sap/zfi_fion_db/perform_action.xml";
			//var param:Object = new Object();
			//param.XML = paramText.text;
			//myService.request = myXML;
			myService.method = "GET";
			myService.resultFormat = "e4x";
			
			myService.request = param;
			return myService.send();
		}
		
		public function getById(tableName:String):AsyncToken
		{
			return myService.send();
		}
		
		public function deActivateById(id:String):AsyncToken
		{
			return myService.send();
		}
		
		public function create(xml:Object):AsyncToken
		{
			return myService.send();
		}
	}
}